package com.jack.thinking.thread.core._3;

public class JoinThread {
	public static void main(String[] args) {
		MyJoin mj = new MyJoin();
		mj.start();
		try {
			mj.join();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("*");
	}
}

class MyJoin extends Thread{
	@Override
	public void run() {
		System.out.println("-");
		try {
			Thread.sleep(1000L);
			synchronized (this) {
				notifyAll();
			}
			Thread.sleep(1000L);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("-");
	}
}
